

// includes, system
#include <iostream>
#include <stdlib.h>
#include <vector>

#include "Genetic_Algorithm_Config.h"
#include "Neural_Network_Config.h"
#include "DatasetReader.h"
////////////////////////////////////////////////////////////////////////////////
// declaration, forward

extern "C" void train( ANNDATA* trainData, int trainDataSize);

////////////////////////////////////////////////////////////////////////////////
// Program main
////////////////////////////////////////////////////////////////////////////////
int
main(int argc, char** argv)
{
	ANNDATA* trainingData;
	
	//create neural network config structure
	//NNconfig ann_cnfg;
	//ann_cnfg.layerNums[0] = 1;
	//ann_cnfg.layerNums[1] = 6;
	//ann_cnfg.layerNums[2] = 1;


	

	//read data file
	std::vector<DataPair<double>>  datasets = 	DatasetReader::getInstance()->parseFile<double>("sin_0_25.dat",INPUT_NUM,OUTPUT_NUM,TYPE::DOUBLE);

	int size = datasets.size ();

	trainingData = new ANNDATA[datasets.size ()];

	int dataPairNumber = datasets.size ();
	for(int i = 0 ; i < dataPairNumber ; i++){
		
		for(int inIndex = 0 ; inIndex < INPUT_NUM ; inIndex++)
			trainingData[i].input[inIndex] = datasets[i].inputs[inIndex];

		for(int outIndex = 0 ; outIndex < OUTPUT_NUM ; outIndex++)
			trainingData[i].output[outIndex] = datasets[i].outputs[outIndex];
	}
	
	train (trainingData,dataPairNumber);
    
}
